import request from '@/utils/request'

// 查询作业试卷列表
export function listPaper(query) {
  return request({
    url: '/system/markPapers/paper/list',
    method: 'get',
    params: query
  })
}

// 查询作业试卷详细
export function getPaper(jobTestPaperId) {
  return request({
    url: '/system/markPapers/paper/' + jobTestPaperId,
    method: 'get'
  })
}

// 新增作业试卷
export function addPaper(data) {
  return request({
    url: '/system/paper',
    method: 'post',
    data: data
  })
}

// 修改作业试卷
export function updatePaper(data) {
  return request({
    url: '/system/paper',
    method: 'put',
    data: data
  })
}

// 删除作业试卷
export function delPaper(jobTestPaperId) {
  return request({
    url: '/system/markPapers/paper/' + jobTestPaperId,
    method: 'delete'
  })
}


// pase64上传
export function base64ToUrl(data) {
  return request({
    url: '/common/upload/base64',
    method: 'post',
    data: data
  })
}

//教师阅卷(线下卷)
export function teacherMarkPaper(data) {
  return request({
    url: '/system/markPapers/paper',
    method: 'put',
    data: data
  })
}

//教师阅卷(线上卷)
export function teacherMarkPaperOline(data) {
  return request({
    url: '/system/markPapers/paper/checkedPaper',
    method: 'post',
    data: data
  })
}


// 新增线下录入试卷
export function addPaperData(data) {
  return request({
    url: '/system/markPapers/paper',
    method: 'post',
    data: data
  })
}

// 查询已阅卷作业试卷详细
export function getPaperMarking(jobTestPaperId) {
  return request({
    url: '/system/markPapers/paper/checkedPaper/' + jobTestPaperId,
    method: 'get'
  })
}

// 查询已阅卷的答疑区
export function getPaperMarkingQA(jobTestPaperId) {
  return request({
    url: '/system/reply/list' ,
    method: 'get',
    params: {
      jobTestPaperId: jobTestPaperId
    }
  })
}

// 新增已阅卷的答疑区评论
export function addPaperMarkingQA(data) {
  return request({
    url: '/system/reply' ,
    method: 'post',
    data:data
  })
}

//查询学生无分页
export function getUserList(data) {
  return request({
    url: '/system/user/list/nopage',
    method: 'get',
    params:data
  })
}


// 查询线上作业试卷列表
export function listOnlinePaper(query) {
  return request({
    url: '/system/examinationClassification/examination/onlineExaminationList',
    method: 'get',
    params: query
  })
}


// 查询线上作业试卷详细
export function getOnlinePaper(studentTestAnswerId) {
  return request({
    url: '/system/markPapers/answer/' + studentTestAnswerId,
    method: 'get'
  })
}

//查询每个学生的答案
export function getOnlineStudentAnswer(examinationAndUserId) {
  return request({
    url: '/system/examinationClassification/user/' + examinationAndUserId,
    method: 'get'
  })
}

// 查询线上已阅卷作业试卷列表
export function getOnlinePaperList(query) {
  return request({
    url: '/system/examinationClassification/user/listUnexaminedPaper' ,
    method: 'get',
    params: query
  })
}

// 查询线上已阅卷作业试卷列表1
export function getOnlinePaperList1(query) {
  return request({
    url: '/system/markPapers/answer/checkedPaper/list' ,
    method: 'get',
    params: query
  })
}

//查询线上已阅卷的阅卷详情
export function getOnlineStudentAnswerDetail(examinationAndUserId) {
  return request({
    url: '/system/markPapers/paper/online/checkedPaper/' + examinationAndUserId,
    method: 'get'
  })
}
